package edu.task.snake.view;


import edu.task.snake.controller.GameEngine;
import edu.task.snake.model.Frog;

import javax.swing.ImageIcon;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.ImageObserver;


public class FrogRender {

    Image image;
    ImageObserver observer;
    Frog model;

    public FrogRender(ImageObserver observer, Frog model) {
        ImageIcon iia = new ImageIcon(this.getClass().getResource("apple.png"));
        this.image = iia.getImage();
        this.observer = observer;
        this.model = model;
    }

    public void render(Graphics g) {
        int scale = GameEngine.getCellSizePixel();
        g.drawImage(image
                , model.getX() * scale
                , model.getY() * scale
                , scale
                , scale
                , observer); //ToDo To FrogRender View
    }
}
